<?php
namespace app\shop\validate;
use think\Validate;
class Contract extends Validate
{
    protected $rule = [
        'id'=>'require',
        'title' => 'require',
        'content' => 'require',
        'field' => 'require',
        'user_id'=> 'require',
        'tpl_id'=>'require',
        'sign'=>'require',
    ];
    protected $message = [
        'id.require' => '参数错误',
        'title.require' => '请输入合同名称',
        'content.require' => '请输入合同内容',
        'field.require' => '请输入合同字段',
        'user_id.require' => '请选择员工',
        'tpl_id.require' => '请选择合同模板',
        'sign.require' => '请输入合同签名'
    ];
    protected $scene = [
        'addTpl' => ['title', 'content', 'field'],
        'editTpl' => ['id','title', 'content', 'field'],
        'info' => ['id'],
        'add' => ['user_id','tpl_id','content'],
        'edit' => ['id'],
        'sign'=>['id','sign'],
    ];
}